﻿using System;
using System.Data.SqlClient;

namespace EasyBuy.DAL
{
    /// <summary>
    /// EasyBuy数据库管理类
    /// By:田玉粮
    /// 2012-7-15
    /// </summary>
    public static class EasyBuyUntil
    {
        #region 成员
        private static SqlConnection _conn = null;

        private static readonly String strEasyBuyConn = @"server=TYL\MSSQLSERVER2008;Initial Catalog=EasyBuy;uid=sa;pwd=cddx";

        /// <summary>
        /// /获取EasyBuy数据库连接字符串(SQL集成登录，sa,cddx)
        /// </summary>
        public static String GetEasyBuyConnString
        {
            get
            {
                return strEasyBuyConn;
            }
        }

        /// <summary> 
        /// 获得EasyBuy数据库连接对象的实例
        /// </summary>
        public static SqlConnection GetEasyBuyConn
        {
            get
            {
                if (_conn == null)
                {
                    _conn = new SqlConnection(strEasyBuyConn);
                }
                return _conn;
            }
        } 
        #endregion

    }
}
